1. Technical Field
The present invention generally relates to computer systems. More specifically, the present invention relates to a method and system for determining optimal column widths used in the rendering of data tables displayed in a graphical user interface.
2. Description of the Related Art
Computer systems display data to a user on a display or monitor in a visual format. The visual rendering of data from a database is typically displayed on the display or monitor in a window or table format. A graphical user interface (GUI) is used to present the data and information to a user in a format that is readily comprehended. The table can include an array of cells arranged in rows and columns. The graphical user interface allows the application to display information in the cells. The number of characters contained in the fields or field length displayed in cells can vary widely depending upon the data contained in the database. For example, some fields can have a short field length containing few characters and other fields can have a long field length with long sequences of characters.
In some applications, the user is allowed to choose or select display preferences within the graphical user interface. For example, the user may be allowed to use an input device such as a mouse to selectively change the number of columns displayed, the height of a row or the width of a column. Unfortunately, it is difficult to determine the height of a row or the width of a column to be displayed because of the variable field length. If the longest field length is used to determine the column width, the resulting column width in the table may be over sized resulting in excessive empty spaces. If the shortest field length is used to determine the column width, the resulting column width in the table may be too small resulting in cells with a truncated set of characters displayed. An improved method of determining column widths in a table is needed.